<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 数组的递增赋值(在数组的尾部添加一个新的元素)
    var a = [2,6,5,3];
    a[a.length] = 6;
    a[a.length] = "w";
    console.log(a);

    // 封装一个方法 => 向一个数组的尾部添加一个元素
    function b(a2 , c){
        a2[a2.length] = c;
        return a2
    }

    var arr = [3,5,9];
    var result = b (arr ,4 )
    console.log(result)

    // 删除数组尾部的元素
    var sc = [5,6,9];
    console.log(sc);

    function wei(sc){
        sc.length--;
        return sc;
    }
    console.log(wei(sc));
</script>
</html>